<?php	
global $post;

if( !$post ) {
    $post = $wp_query->post;
}

if( $post->comment_status != 'closed' ):
	if( post_password_required() ): 
?>
        <p class="nopassword">
            <?php
            $msg = 'This post is password protected. Enter the password to view any comments.';
            _e( $msg, LANGUAGE_ZONE );
            ?>
        </p>
    <?php
        /* Stop the rest of comments.php from being processed,
        * but don't kill the script entirely -- we still have
        * to fully load the template.
        */
        return;
    endif;
    ?>
    
	<?php if ( have_comments() ): ?>
			<h1 class="share_comment">
                <?php
                comments_number(
                    '',
                    __('1 Comment:', LANGUAGE_ZONE),
                    __('% Comments:', LANGUAGE_ZONE)
                );
                ?>
            </h1>
			<?php
            wp_list_comments(
                array(
                    'max_depth'     => 3,
                    'style'         => 'div',
                    'callback'      => 'single_comments',
                    'end-callback'  => 'end_callback',
                    'comments_nmbr' => intval(get_comments_number())
                )
            );
            ?>
			<?php paginate_comments_links(); ?>
	<?php endif; ?>
		<?php
		global $user_identity, $user_email, $user_login;
        $user = $email = '';
        
        get_currentuserinfo();
		if( is_user_logged_in() ) {
            $user = $user_identity;
            $email = $user_email;
        }
        
		?>
        <?php //comment_form(); ?>
        <div id="form_prev_holder">
            <div id="form_holder">
                
                <h1 class="share_comment">
                    <?php _e( 'Share a comment:', LANGUAGE_ZONE ); ?>
                </h1>
                
                <?php
                /* if( !is_user_logged_in() ): ?>
                
                <small>
                    <?php
                    $msg = 'Your email address will not be published. All fields are required.';
                    _e( $msg, LANGUAGE_ZONE );
                    ?>
                </small>
                
                <?php else: ?>
                
                <small>
                    <?php echo __( 'You logged in like ', LANGUAGE_ZONE ); ?>
                    <a href="/wp-admin/profile.php">
                        <?php echo $user_login; ?>
                    </a>
                </small>
                
                <?php endif; */
                ?>
                
                <form action="<?php echo site_url('/wp-comments-post.php'); ?>" method="post" class="uniform">
                    <?php if( !is_user_logged_in() ): ?>
                        
                        <div class="i_h">
                            <div class="l">
                                <input id="name2" name="author" type="text" placeholder="<?php esc_attr_e('*Your name', LANGUAGE_ZONE); ?>" class="validate[required]" value="<?php echo $user; ?>"/>
                            </div>
                        </div>

                        <div class="i_h">
                            <div class="r">
                                <input id="email2" name="email" type="text" placeholder="<?php esc_attr_e('*E-mail', LANGUAGE_ZONE); ?>" class="validate[required,custom[email]" value="<?php echo $email; ?>"/>
                            </div>
                        </div>

                    <?php endif ?>
                    <div class="t_h">
                        <textarea type="text" name="comment" id="message2" placeholder="<?php esc_attr_e('*Message', LANGUAGE_ZONE); ?>" class="validate[required]"></textarea>
                    </div>
                    
                    <a href="#" class="the_button go_submit go_button" title="<?php _e( 'Add comment', LANGUAGE_ZONE ); ?>">
                        <span><?php _e( 'Add comment', LANGUAGE_ZONE ); ?><i></i></span>
                    </a>
                    
                    <a href="#" class="do_clear"><?php _e( 'Cancel', LANGUAGE_ZONE ); ?></a>
                    
                    <?php comment_id_fields(); ?>
                    <?php do_action('comment_form', $post->ID); ?>
                </form> 
            </div><!-- form_holder-->
        </div><!-- form_prev_holder -->

<?php endif; ?>